package com.itheima.reflect;

import com.itheima.domain.Student;

import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.rmi.StubNotFoundException;
import java.util.Arrays;

/*
接口
父类
注解
 */
public class Demo05 {

    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {

        Class<Student> clazz = Student.class;
        Class<?>[] interfaces = clazz.getInterfaces();
        System.out.println(Arrays.toString(interfaces));
        Type[] genericInterfaces = clazz.getGenericInterfaces();
        System.out.println(Arrays.toString(genericInterfaces));

        Class<? super Student> superclass = clazz.getSuperclass();
        System.out.println(superclass);
        Type genericSuperclass = clazz.getGenericSuperclass();
        System.out.println(genericSuperclass);


        Annotation[] annotations = clazz.getAnnotations();
        System.out.println(Arrays.toString(annotations));
      /*  Constructor<Student> declaredConstructor = clazz.getDeclaredConstructor();
        declaredConstructor.setAccessible(true);
        Student student = declaredConstructor.newInstance();
*/

        Student student1 = clazz.newInstance();

    }
}
